/**
 * Copyright(c) 2025 hbswxx.com, All Rights Reserved. Author: kouqiang Create date: 2025/6/4
 */
package cn.sw.syncdata.job;

import cn.sw.syncdata.job.heart.ThreadCreateEMLog;
import cn.sw.syncdata.job.heart.ThreadCreatePort;
import cn.sw.syncdata.threadpool.ThreadPoolManager;
import org.springframework.stereotype.Service;

/**
 * description:
 *
 * @author kouqiang
 * @date 2025/6/4 16:48
 */
@Service
public class CreateEMLogJob {
    private final int limit =5000000;
    public void createEmlJob(String sdate, String edate, int total) {
        //判断需要执行的任务线程数
//        int limit=total/10;
        int numJob = total / limit + 1;
        System.out.println("开始创建monitoringLog数据，合计任务数量" + numJob);
        for (int i = 0; i < numJob; i++) {
            ThreadCreateEMLog threadCreatePort = new ThreadCreateEMLog(limit,  sdate, edate,"d:\\tmp\\emlog" + i + ".csv");
            ThreadPoolManager.submitThread(threadCreatePort);
        }
    }
}
